Texture mapping is a technique whereby images generated by computer displays maybe made to seem more realistic. In graphics and animation applications (e.g., 2-D and 3-D graphics including games, simulations, and the like) objects may be rendered as two dimensional or three dimensional objects by representing such objects as a collection of polygon shapes.
2-D image mapping or warping may be employed in graphics systems such as the proposed Talisman.TM. graphics system promoted by Microsoft.TM.. Such a system may utilize affine transformations to rotate BitBlts operations to alter the shape, size, and perspective of objects on a screen.
In video applications, scaling or warping may be achieved using 2-pixel horizontal filters and 3- or 4-line horizontal filters to reduce, enlarge, or otherwise alter a video image.
In three dimensional animation (i.e., "3-D"), such objects may be re-rendered when a user (or player's) position changes, or when the position of an object on the screen changes in order to preserve correct perspective and the like.
However, simple polygon images do not impart the appearance of realism to a game, simulation, or graphic rendering. Texture mapping is a technique whereby stored images of surface textures or appearances may be applied to polygon surfaces to provide an enhanced appearance of realism. Texture mapping is explained in more detail in related co-pending U.S. Pat. No. 5,630,043 issued May 13, 1997 entitled "ANIMATED TEXTURE MAP APPARATUS AND METHOD FOR 3-D IMAGE DISPLAYS" incorporated herein by reference.
A texture map may comprise a pattern, such as a brick pattern or the like, that may be repeated to form a texture image to cover a polygon surface. Texture maps may also represent scanned in photographic images or the like, and may cover an entire polygon surface with or without repetition.
In 3-D animation rendering, however, a polygon image may be continually re-rendered in different positions, perspectives, and sizes, depending upon the orientation of an object on the screen and the perceived distance of the object from the viewer. Thus, texture map data may need to be interpolated to fit to a polygon image. In other words, an individual datum of texture map data may not correspond to one pixel of display data. Thus, individual pixels of display data may need to be interpolated from adjacent datum of texture map data.
Prior art texture mapping engines use various mapping algorithms such as linear, bi-linear, tri-linear, and anisotropic. These various filters are based upon a linear interpolation between a set of texture values and how the sample point relates spatially to the texture values. FIG. 1 is a diagram illustrating the operation of a prior art two-tap (bi-linear) texture map filter used to interpolate texture map data to generate pixel data.
In FIG. 1, sample point P represents a position within a texture map from which pixel data is to be generated. Values Ta, Tb, Tc, and Td represent four adjacent values of texture map (or other) data. Values Ta, Tb, Tc, and Td may represent any of Y, U, or V data, R,G, or B data, or the like. The number of bits and value range for each of values Ta, Tb, Tc, and Td may vary depending upon pixel depth, compression, and the like.
The relative position between sample point P and values Ta, Tb, Tc, and Td may be determined by dimension u horizontally, and dimension v vertically. Using simple two-tap (bi-linear) interpolation, the value for sample point P may be generated from equation 1: EQU P=v*(u*Ta+(1-u)Tb)+(1-v)*(u*Tc+(1-u)Td) (1)
Where u and v are between 0 and 1.
Recently, four-tap texture filters have been used for texture mapping. Four-tap filters may utilize four input values from both horizontal and vertical directions to sample up to 16 data values. A four-tap texture filter may produce better interpolation results and reduce the amount of artifacts and the like in the resultant image.
Such four-tap filters have been based upon fixed functions which are symmetrical in both horizontal and vertical directions. These fixed functions define the weighting used along columns and rows to sample the final value, and may comprise, for example, a Gaussian filter. Such filters have been shown to be useful for filtering a previously lossy compressed image or texture.
Video applications are beginning to explore an asymmetrical filtering system wherein the filter is a two-tap filter for horizontal interpolation, but vertically, a three-tap filter may be used to eliminate flicker or interlace effects. In the prior art, separate fixed filtering units are used in each of the above applications (as well as other applications). Thus, each filter is application specific, and separate filters may be required for texture map filters and for video filtering.
Moreover, different types of data may respond better to different filter types. For example, a more equal weighting in a four-tap filter will blur or wash out any high frequency data because of its averaging effect. Such a filtering technique may be useful for images such a cloud textures, where a "soft" look is desirable. Other images may respond better to a two-tap filter with different interpolation techniques for horizontal and vertical functions in order to avoid blurring edges and the like.
In the prior art, to provide such separate filter types for different applications and/or data types may be cumbersome and expensive.